<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>推荐管理</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		.nav-tabs li{cursor: pointer;}
	</style>
</head>
<body>
	<sys:message content="${message}"/>
	<div id="content" class="row-fluid">
		<div id="right" >
			<ul class="nav nav-tabs">
				<li class="tabli active" link="iframeContent1"><a >推荐列表</a></li>
				<shiro:hasPermission name="cms:racevideo:edit">
					<li class="tabli " link="iframeContent2"><a >推荐详情</a></li>
				</shiro:hasPermission>
			</ul>
			<div id="iframeContentDiv">
				<iframe id="iframeContent1" name="iframe" url='${ctx}/cms/recommen/' src="" width="100%" height="91%" frameborder="0"></iframe>
				<iframe id="iframeContent2" name="iframe" url='${ctx}/cms/recommen/form' src="" width="100%" height="91%" frameborder="0"></iframe>
			</div>
		</div>
	</div>
	
<script type="text/javascript">
	//URL
	var listUrl = '${ctx}/cms/recommen/';
	var cardUrl = '${ctx}/cms/recommen/form';
	
	var leftWidth = 180; // 左侧窗口大小
	var htmlObj = $("html"), mainObj = $("#main");
	var frameObj = $("#left, #openClose, #right, #right iframe");
	function wSize(){
		var strs = getWindowSize().toString().split(",");
		htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
		mainObj.css("width","auto");
		frameObj.height(strs[0] - 5);
		var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
		$("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
		$(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
	}
		
	$(document).ready(function() {
		jQuery('.tabli').click(function(){
			changeTabs(this);
		});
		freshTabs(jQuery('[link="iframeContent1"]'));
	});
	
	function freshTabs(obj,url){ //刷新页卡
		 jQuery('.tabli').removeClass('active');
		 jQuery(obj).addClass('active');
		 var iframeId = jQuery(obj).attr('link');
		 var iframeContents = jQuery('#iframeContentDiv').find('iframe');
		 iframeContents.css('display','none');
		 jQuery('#'+iframeId).css('display','');
		 
		 //debugger;
		 if(url!=null){
			 jQuery('#'+iframeId).attr('src',url);
		 }else{
			 jQuery('#'+iframeId).attr('src', jQuery('#'+iframeId).attr('url'));
		 }
	}
	
	function changeTabs(obj){ //切换页卡
		jQuery('.tabli').removeClass('active');
		 jQuery(obj).addClass('active');
		 var iframeId = jQuery(obj).attr('link');
		 var iframeContents = jQuery('#iframeContentDiv').find('iframe');
		 iframeContents.css('display','none');
		 jQuery('#'+iframeId).css('display','');
		 if(jQuery('#'+iframeId).attr('src') == null ||jQuery('#'+iframeId).attr('src') == ''){
			 jQuery('#'+iframeId).attr('src', jQuery('#'+iframeId).attr('url'));
		 }
	}
	
</script>
<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
</body>
</html>